/**
 * @author:albert
 */
package com.bkbw.live.battle.business.ai;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.badlogic.gdx.ai.btree.Task;
import com.badlogic.gdx.ai.msg.Telegram;
import com.bkbw.live.common.GameConfig;
import com.bkbw.live.battle.business.BuildingObject;
import com.bkbw.live.battle.business.UnitObject;

public class BtSearchEnemy<EntityType extends UnitObject> extends BaseLeafNode<EntityType> {

	Logger logger = LoggerFactory.getLogger(GameConfig.LoggerName);
	
	@Override
	public boolean handleMessage(Telegram paramTelegram) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public com.badlogic.gdx.ai.btree.Task.Status execute() {
		// TODO Auto-generated method stub
		EntityType entity = getObject();
		if (entity.searchEnemy() != null) {
			//logger.debug("search succ");
			
			return Status.SUCCEEDED;
		}
		else {
			
			//logger.debug("search fail");
			return Status.FAILED;
		}
	}

	@Override
	protected Task<EntityType> copyTo(Task<EntityType> paramTask) {
		// TODO Auto-generated method stub
		return null;
	}

}
